package com.aishua.fire.common.eenum;

import lombok.extern.slf4j.Slf4j;

/**
 * 白名单接口列表
 * @author Administrator
 *
 */
@Slf4j
public enum TwoLevelMenuEnum {

	
	
	/** 系统管理-start **/
	DEFAULT(null,null,null,null),
	SYS_ACCOUNT("系统账户",null,"0",OneLevelMenuEnum.SYS_Manager),
	SYS_ACCOUNTTEAM("角色",null,"1",OneLevelMenuEnum.SYS_Manager),
	SYS_PERMISSSION("权限",null,"2",OneLevelMenuEnum.SYS_Manager),
	DICT_CONFIG("字典配置",null,"3",OneLevelMenuEnum.SYS_Manager);
	/** 系统管理-end **/
	

	/** 二级菜单名**/
	private String twoLevelMenuName;
	/** 路由url **/
	private String routeUrl;
	/** 序号 **/
	private String orderNum;
	
	private OneLevelMenuEnum oneLevelMenuEnum;

	private TwoLevelMenuEnum(String twoLevelMenuName, String routeUrl, String orderNum,
			OneLevelMenuEnum oneLevelMenuEnum) {
		this.twoLevelMenuName = twoLevelMenuName;
		this.routeUrl = routeUrl;
		this.orderNum = orderNum;
		this.oneLevelMenuEnum = oneLevelMenuEnum;
	}

	public String getTwoLevelMenuName() {
		return twoLevelMenuName;
	}

	public void setTwoLevelMenuName(String twoLevelMenuName) {
		this.twoLevelMenuName = twoLevelMenuName;
	}

	public String getRouteUrl() {
		return routeUrl;
	}

	public void setRouteUrl(String routeUrl) {
		this.routeUrl = routeUrl;
	}

	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	public OneLevelMenuEnum getOneLevelMenuEnum() {
		return oneLevelMenuEnum;
	}

	public void setOneLevelMenuEnum(OneLevelMenuEnum oneLevelMenuEnum) {
		this.oneLevelMenuEnum = oneLevelMenuEnum;
	}
	
	public static TwoLevelMenuEnum getByMenuName(String menuName) {
		for(TwoLevelMenuEnum twoLevelMenuEnum : values()) {
			if(twoLevelMenuEnum.getTwoLevelMenuName().equals(menuName)) {
				return twoLevelMenuEnum;
			}
		}
		log.warn("存在未配置的菜单:{}",menuName);
		return null;
	}
	
}
